﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace 线程通知
{
    class Program
    {
        static ManualResetEvent reset = new ManualResetEvent(true);
        static void Main(string[] args)
        {

            var s = DateTime.Now - DateTime.Now.AddDays(-99);

            Uri uri = new Uri("http://s.5173.com?ad=ddddd");
            var x = uri.AbsoluteUri.IndexOf("http://s.5173.com", StringComparison.OrdinalIgnoreCase);

            Run();
            Console.ReadKey();
            reset.Set();
            reset.Reset();

            Console.WriteLine("end");
            Console.ReadKey();
        }
        static void Run()
        {
            Task.Factory.StartNew(() =>
            {
                Console.WriteLine("run.... rest");
                reset.Reset();
                Console.WriteLine("run.... waitone");
                reset.WaitOne();
                Console.WriteLine("run.... end");
            });
        }
    }
}
